package net.xujialiang.XTestRPA.Repository.Env;

import net.xujialiang.XTestRPA.Entity.Env.XRPAEnvGroup;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface EnvGroupRepository extends CrudRepository<XRPAEnvGroup, Integer> {
    Page<XRPAEnvGroup> findAllByTtc(String ttc, Pageable pageable);
    @Query("SELECT c FROM XRPAEnvGroup c WHERE c.ttc = :ttc and (:groupName is null or c.groupName = :groupName)")
    Page<XRPAEnvGroup> findAllByTtcAndGroupName(String ttc, String groupName,Pageable pageable);
}
